﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PeachLite.Admin
{
    public partial class ArticleList : DataPage
    {
        protected override string Sql
        {
            get
            {
                int t;
                int s = 2;
                //当前页码
                int i = Request.QueryString["i"] == null ? 1 : int.TryParse(Request.QueryString["i"].Trim(), out t) ? t : 1;
                string c = Request.QueryString["cid"] == null ? "" : Request.QueryString["cid"].Trim();
                string k = Request.QueryString["k"] == null ? "" : Server.UrlDecode(Request.QueryString["k"].ToLower().ToString());
                QueryString = "cid=" + c + "&k=" + k;

                if (!string.IsNullOrWhiteSpace(c))
                {
                    try
                    {
                        c = int.Parse(c).ToString();
                    }
                    catch
                    {
                        return "";
                    }

                }

                return "sp_Admin_Page_ArticleList '" + k + "','" + c + "'," + s.ToString() + "," + i.ToString() + "";
            }
        }

        protected override string[] FormatString
        {
            get
            {
                string[] fs = { "<tr aid='{0}'><td class='td1'>{1}</td><td class='td2'>{2}</td><td>{3}</td><td class='td4'>{4}</td><td class='td5'><a class='btn edit' href='articleedit2.aspx?aid={5}'>&#xf040;</a><a class='btn del' onclick='del(this);'>&#xf00d;</a></td></tr>" };
                return fs;
            }
        }
    }
}